home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / GR-FOSS.ZIP / X00153A.ZIP / X00REF.DOC < prev    next >
Text File  |  1993-12-12  |  64KB  |  1,652 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.                    Functions reference manual for the X00 developer
  28.  
  29.                   X.00 A Low Level Serial I/O Communications Driver
  30.                         for MS DOS and like Operating Systems.
  31.  
  32.                         Copyright (c) 1993 by Raymond L. Gwinn
  33.                                  12469 Cavalier Drive
  34.                               Woodbridge, Virginia 22192
  35.                                  All Rights Reserved
  36.  
  37.                                   December 12, 1993
  38.  
  39.  
  40.                    Fidonet address 1:265/104 (Routed Netmail only)
  41.                                  Compuserve 72570,157
  42.                           Internet 72570.157@Compuserve.com
  43.                                    FAX 703-494-0595
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.                                                                           i
  52.  
  53.  
  54.                                      INTRODUCTION
  55.  
  56.           Previously,  the documentation  for X00  was  little more  than a
  57.           collection  of notes.  The notes were added to as the development
  58.           process continued and enhancements were made.  I honestly did not
  59.           suspect that  X00 would become  as widely  used as it  is.   This
  60.           manual is an attempt at some decent documentation for X00.
  61.  
  62.           But who do  I document for?   The user that  is setting up a  BBS
  63.           just wants to get X00 installed and to move on  to more important
  64.           things.  The user that is having problems needs information about
  65.           serial  I/O communications  in general  and the  PC specifically.
  66.           The application developer (programmer) needs detailed information
  67.           about each individual function and the information generated.
  68.  
  69.           This manual is  intended as  a reference for  use by  application
  70.           programmers who desires  to use X00.  A separate  Users manual is
  71.           included in the distribution file(s).
  72.  
  73.           This manual and the software distributed with it is provided with
  74.           no guarantees.  Use at your own risk.
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.                                                                          ii
  83.  
  84.  
  85.           WHAT IS X00 . . . . . . . . . . . . . . . . . . . . . . . . .   1
  86.  
  87.           Warranty  . . . . . . . . . . . . . . . . . . . . . . . . . .   1
  88.  
  89.           Licensing Information . . . . . . . . . . . . . . . . . . . .   2
  90.                Non-Commercial License . . . . . . . . . . . . . . . . .   2
  91.                Commercial License . . . . . . . . . . . . . . . . . . .   2
  92.  
  93.           Functions . . . . . . . . . . . . . . . . . . . . . . . . . .   3
  94.                Function 00h - Set communications parameters . . . . . .   4
  95.                Function 01h - Transmit character and wait . . . . . . .   5
  96.                Function 02h - Get received character with wait  . . . .   5
  97.                Function 03h - Return Serial Port Status . . . . . . . .   6
  98.                Function 04h - Activate Port . . . . . . . . . . . . . .   7
  99.                Function 05h - Deactivate Port . . . . . . . . . . . . .   8
  100.                Function 06h - Raise/lower DTR . . . . . . . . . . . . .   8
  101.                Function 07h - Return timer tick information . . . . . .   9
  102.                Function 08h - Flush output buffer . . . . . . . . . . .   9
  103.                Function 09h - Purge output buffer . . . . . . . . . . .   9
  104.                Function 0Ah - Purge input buffer  . . . . . . . . . .    10
  105.                Function 0Bh - Transmit no wait  . . . . . . . . . . .    10
  106.                Function 0Ch - Non-destructive read-ahead (Peek) . . .    10
  107.                Function 0Dh - Keyboard read without wait  . . . . . .    11
  108.                Function 0Eh - Keyboard read with wait . . . . . . . .    11
  109.                Function 0Fh - Flow Control for serial I/O . . . . . .    12
  110.                     Xon/Xoff flow control . . . . . . . . . . . . . .    12
  111.                     RTS/CTS flow control  . . . . . . . . . . . . . .    12
  112.                Function 10h - Control-C / Control-K checking  . . . .    13
  113.                Function 11h - Set current cursor location . . . . . .    13
  114.                Function 12h - Read current cursor location  . . . . .    14
  115.                Function 13h - Single character ANSI write to screen .    14
  116.                Function 14h - Enable or disable the DCD watchdog  . .    14
  117.                Function 15h - Write character to screen using BIOS  .    15
  118.                Function 16h - Add  or delete a routine from  the timer
  119.                     tick  . . . . . . . . . . . . . . . . . . . . . .    15
  120.                Function 17h - Reboot system . . . . . . . . . . . . .    16
  121.                Function 18h - Block Read  . . . . . . . . . . . . . .    16
  122.                Function 19h - Block Write . . . . . . . . . . . . . .    16
  123.                Function 1Ah - Break begin or end  . . . . . . . . . .    17
  124.                Function 1Bh - Return information about X00  . . . . .    18
  125.  
  126.           Superset Functions  . . . . . . . . . . . . . . . . . . . .    19
  127.                Function 1Ch - Activate Port . . . . . . . . . . . . .    20
  128.                Function 1Dh - Deactivate Port . . . . . . . . . . . .    21
  129.                Function 1Eh - Extended line control initialization  .    22
  130.                Function 1Fh - Extended serial port status/control . .    24
  131.                Function 20h - Read with no wait (destructive) . . . .    25
  132.                Function 21h - Stuff/Poke the receive buffer . . . . .    25
  133.  
  134.           "Layered Application" services  . . . . . . . . . . . . . .    26
  135.                Function  7Eh  -  Install  an   "external  application"
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.                                                                         iii
  144.  
  145.                     function  . . . . . . . . . . . . . . . . . . . .    26
  146.                Function  7Fh  -   Remove  an  "external   application"
  147.                     function  . . . . . . . . . . . . . . . . . . . .    27
  148.  
  149.           Application Notes . . . . . . . . . . . . . . . . . . . . .    28
  150.                Which Activate/Deactivate functions to use . . . . . .    28
  151.                Watch out for disk I/O . . . . . . . . . . . . . . . .    28
  152.                Successive timer tick calls  . . . . . . . . . . . . .    29
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.                                                                           1
  161.  
  162.  
  163.                                      WHAT IS X00
  164.  
  165.           X00 is  a Serial  Input/Output (SIO) communications  driver.   It
  166.           provides  an interface  between  an application  program and  the
  167.           serial communications hardware.
  168.  
  169.           X00 was originally  designed as a  FOSSIL driver.   FOSSIL is  an
  170.           acronym  containing the first character of several communications
  171.           programs.  The FOSSIL specification  is basically an extension of
  172.           the PC's BIOS services for serial communications.
  173.  
  174.           Except as  noted in the this Manual, X00 meets the FOSSIL level 5
  175.           specification.   X00 provides  additional functions that  are not
  176.           contained in the FOSSIL level 5 specification.
  177.  
  178.           X00 only works with 8250 (TYPE) serial I/O devices.  Such devices
  179.           include the  8250A, 16450, 16550, 16550A  and the 82510.   If you
  180.           have a PC that  is an IBM or near  compatible which has a  serial
  181.           communication  port, it is likely  that it contains  one of these
  182.           devices.  XU, a  utility distributed with X00, will  identify the
  183.           existence of compatible SIO devices.
  184.  
  185.           Like  other Device  Drivers,  X00 will  do  very little  standing
  186.           alone.  There must be an application(s) program to use X00 before
  187.           you will gain benefit.
  188.  
  189.           Since  the introduction  of the  FOSSILs, a  great number  of new
  190.           communications  programs  have come  into existence.   I  like to
  191.           think  that the FOSSILs are  largely responsible for  this.  Many
  192.           programs that contain their own communications drivers have added
  193.           FOSSIL support.  One notable example is RBBS.
  194.  
  195.           Many  programs  written  to   use  BIOS's  serial  communications
  196.           services will also work with X00.   This gives those programs the
  197.           benefits of buffered interrupt driven I/O.
  198.  
  199.           Warranty
  200.  
  201.           There is none.  Use X00 your own risk.
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.                                                                           2
  210.  
  211.  
  212.                                 Licensing Information
  213.  
  214.           Non-Commercial License:
  215.  
  216.           A  non-commercial license  for  use of  X00  is included  in  the
  217.           distribution file called LICENSE.TXT.
  218.  
  219.           Commercial License:
  220.  
  221.           See Users Reference manual.
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.                                                                           3
  230.  
  231.  
  232.                                       Functions
  233.  
  234.           X00  functions are  designed to  be  called by  assembly language
  235.           programs.    Some  rudimentary  High Level  access  routines  are
  236.           provided  in  the  X00  distribution files.    These  rudimentary
  237.           routines are the so called HLLAPI files.
  238.  
  239.           Parameters for all  X00 functions  are passed in  the basic  808x
  240.           registers.    In  most cases  the  results  of  the function  are
  241.           returned  in registers.    If  no  parameter  is  returned  in  a
  242.           register,  X00 will return the register  unchanged except for the
  243.           AX register.   If no information is returned in  the AX register,
  244.           then its contents upon return from a function is undefined.
  245.  
  246.           Many  (most) of the X00 functions require a port number be passed
  247.           in  the DX register.  Port numbers start at 0 (zero).  Port 0 and
  248.           COM1  are normally the same.  However, this relationship must not
  249.           be assumed.  It is possible for the X00 user to re-map the  ports
  250.           on their  systems.  Please  refer to  the Users  Manual for  more
  251.           information.
  252.  
  253.           I  have  noted that  some  application programs  are  calling X00
  254.           functions from  the timer tick.   This should be done  with care.
  255.           If  the X00 DV option is enabled  at load time, X00 could issue a
  256.           DESQview Pause command as a result  of your call.  I am  not sure
  257.           what  the results of this would be, but it points out the type of
  258.           consideration that  should be done before  issuing function calls
  259.           from the timer tick.
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.                                                                           4
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.           Function 00h - Set communications parameters, baud, parity etc.
  276.  
  277.                Input:    AH = 00h
  278.                          AL = Communications parameters (defined below)
  279.                          DX = Port number
  280.  
  281.                Output:   AX = Port status (see function 03h)
  282.  
  283.           This function is identical to the IBM PC INT 14h BIOS call except
  284.           that 110 baud and 150  baud have been replaced by 19200  baud and
  285.           38400 baud respectively.  The high order 3 bits of AL specify the
  286.           baud rate as follows:  See  functions 1Eh and 1Fh for an enhanced
  287.           version of this  function.   In addition, once  function 1Eh  has
  288.           been used, this function  will not set/reset the baud  rate until
  289.           re-enabled by function 1Eh or by a FOSSIL deinit/init sequence.
  290.  
  291.                          010 =   300 baud
  292.                          011 =   600  ''
  293.                          100 =  1200  ''
  294.                          101 =  2400  ''
  295.                          110 =  4800  ''
  296.                          111 =  9600  ''
  297.                          000 = 19200  '' (Replaces IBM 110 baud setting)
  298.                          001 = 38400  '' (Replaces IBM 150 baud setting)
  299.  
  300.           The low order 5 of AL specify the following:
  301.  
  302.                Bits 4-3 define parity:       0 0  no parity
  303.                                              1 0  no parity
  304.                                              0 1  odd parity
  305.                                              1 1  even parity
  306.  
  307.                Bit 2 defines stop bits:      0    1 stop bit;
  308.                                              1    1.5 bits for 5-bit codes,
  309.                                                   2 for others
  310.  
  311.                Bits 1-0 character length:    0 0  5 bits
  312.                                              0 1  6 bits
  313.                                              1 0  7 bits
  314.                                              1 1  8 bits
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.                                                                           5
  323.  
  324.  
  325.           Function 01h - Transmit character and wait.
  326.  
  327.                Input:    AH = 01h
  328.                          AL = Character
  329.                          DX = Port number
  330.  
  331.                Output:   AX = Port status (see function 03h)
  332.  
  333.           Upon  entry to this function, AL must contain a character that is
  334.           to be transmitted.   If there is room in the transmit buffer, the
  335.           character  buffered.   Otherwise, this  function will  loop until
  336.           their is  room in the buffer or until  a timeout occurs.  If set,
  337.           the high  order bit of  the returned status indicates  a time out
  338.           occurred.   See function 03h.   At the time of  this writing, the
  339.           timeout is set to 30 seconds.
  340.  
  341.           Note:  X00 executes functions with  the interrupt mask  set as it
  342.           was  when entered.   That is,  if X00  is called  will interrupts
  343.           masked, interrupts will  remain masked during  the processing  of
  344.           the function.  If this function is called with interrupts masked,
  345.           it may never return.
  346.  
  347.           -----------------------------------------------------------------
  348.  
  349.           Function 02h - Get received character with wait.
  350.  
  351.               Receive character with wait
  352.  
  353.                Input:    AH = 02h
  354.                          DX = Port number
  355.  
  356.                Output:   AH = Line status (same AH returned by function 3)
  357.                          AL = Input character
  358.  
  359.           If  a character is available in the receive buffer, this function
  360.           returns the next character from the  receive buffer in AL.  If no
  361.           receive character is available, this  function will wait until  a
  362.           character is received or  until a timeout occurs.   If a  timeout
  363.           occurs,  the high order bit of  AH will be set  upon return.  See
  364.           function 03h.   At the time of this writing, the timeout value is
  365.           set to 30 seconds.
  366.  
  367.           Note:  X00 executes functions with  the interrupt mask  set as it
  368.           was when  entered.   That is,  if X00  is called  will interrupts
  369.           masked, interrupts will  remain masked during  the processing  of
  370.           the function.  If this function is called with interrupts masked,
  371.           it may never return.
  372.  
  373.           Function 20h is a get character with no wait.
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.                                                                           6
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.           Function 03h - Return Serial Port Status.
  389.  
  390.                Input:    AH = 03h
  391.                          DX = Port number
  392.  
  393.                Output:   AX = Status bits as follows:
  394.  
  395.                     AH = Line Status, where:
  396.                          Bit 0 = RDA  - input data is available in buffer
  397.                          Bit 1 = OVRN - the input buffer has been overrun
  398.                          Bit 2 = Reserved (Parity error in BIOS INT 14h)
  399.                          Bit 3 = Reserved (Framing error in BIOS INT 14h)
  400.                          Bit 4 = Reserved (Break detect in BIOS INT 14h)
  401.                          Bit 5 = THRE - room is available in output buffer
  402.                          Bit 6 = TSRE - output buffer is empty
  403.                          Bit 7 = Timeout (set by functions 1 and 2 only)
  404.  
  405.           Bit 7 of AH IS ALWAYS ZERO WHEN RETURNED BY FUNCTION 3.  Bit 7 of
  406.           AH may be  set to one by other functions (like 1 and 2) that also
  407.           return status.  When bit 7 of AH is set to one, none of the other
  408.           15 bits returned in AX are valid.
  409.  
  410.                     AL = Modem status, where:
  411.                          Bit 0 = Delta clear to send (not reliable)
  412.                          Bit 1 = Delta data set ready (not reliable)
  413.                          Bit 2 = Delta data carrier detect (not reliable)
  414.                          Bit 3 = Always set to 1 upon return (DUMMY DCD)
  415.                          Bit 4 = Clear to send (CTS)
  416.                          Bit 5 = Data set ready (DSR)
  417.                          Bit 6 = Ring indicator (RI)
  418.                          Bit 7 = Data carrier detect (DCD)
  419.  
  420.           Bit  3  of AL  is  always  returned  set  to  1.    This  enables
  421.           application programs  to use  bit 3  as a  carrier detect bit  on
  422.           hardwired (null modem) links.
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.                                                                           7
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.           Function 04h - Activate Port.
  440.  
  441.                Input:    AH = 04h
  442.                          DX = port number
  443.  
  444.                Output:   AX = 1954h if successful
  445.                          BL   =  maximum  function  number  supported  (not
  446.                          counting functions 7Eh and above)
  447.                          BH = rev of FOSSIL specification supported
  448.  
  449.           This function instructs X00  to use the FOSSIL specification  for
  450.           the specified port.  Prior to issuing this function, any function
  451.           that  requires a port number  in DX be will  passed on to BIOS or
  452.           X00's  INT 14h BIOS emulator.  When this function  is called, all
  453.           interrupts   involved  in  supporting   the  communications  port
  454.           (specified in DX) are  set up for support by X00.   DTR is turned
  455.           on by this function.  The baud rate is NOT set or changed by this
  456.           function.
  457.  
  458.           If an additional call  to this function occurs (2  Inits or Init,
  459.           Function nn, Init, etc.)  X00 will reset (clear) all  buffers and
  460.           all flow control is turned off.  Values returned in the registers
  461.           upon a re-init are the same as an initial init (defined above).
  462.  
  463.           NOTICE:  At some  future date,  the author  intends to  make this
  464.           function identical to the PS/2's  function 4.  Function 1Ch  is a
  465.           duplicate of this function.  New or modified application programs
  466.           should  discontinue use  of this function  and use  the duplicate
  467.           (1Ch) function.
  468.  
  469.           A section is the  application notes describes a simple  method of
  470.           determining  which Activate/Deactivate  function numbers  to use.
  471.           The described method should work on all FOSSIL implementations.
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.                                                                           8
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.           Function 05h - Deactivate Port.
  487.  
  488.                Input:    AH = 05h
  489.                          DX = Port number
  490.  
  491.                Output:   Nothing
  492.  
  493.           This function  instructs X00  that it  should  no longer  process
  494.           calls for specified port (in  DX) using the FOSSIL specification.
  495.           If the port was never activated by function 4, then this function
  496.           is ignored.  Any  subsequent function calls, that require  a port
  497.           number  in  DX, will  be  passed  to BIOS  or  the  BIOS INT  14h
  498.           emulator.
  499.  
  500.           NOTICE:  At some  future date  (July 1991  or later),  the author
  501.           intends to make this function identical to the PS/2's function 5.
  502.           Function 1Dh is  a duplicate of this  function.  New  or modified
  503.           application programs should discontinue use of this function  and
  504.           use the duplicate (1Dh) function.
  505.  
  506.           A section is the  application notes describes a simple  method of
  507.           determining  which Activate/Deactivate  function numbers  to use.
  508.           The described method should work on all FOSSIL implementations.
  509.  
  510.           -----------------------------------------------------------------
  511.  
  512.           Function 06h - Raise/lower DTR.
  513.  
  514.                Input:    AH = 06h
  515.                          AL = DTR state to set
  516.                          DX = Port number
  517.  
  518.                Output:   Nothing
  519.  
  520.           This function is used to control the DTR signal.   AL = 00h means
  521.           lower DTR (turn it off), and AL = 01h means to raise DTR (turn it
  522.           on).  No other function (except functions 04h and 1Ch) will alter
  523.           DTR.
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.                                                                           9
  532.  
  533.  
  534.  
  535.           Function 07h - Return timer tick information.
  536.  
  537.                Input:    AH = 07h
  538.  
  539.                Output:   AL = Timer tick interrupt number
  540.                          AH = Approximate interrupts per second (18 on IBM)
  541.                          DX = Approximate number of milliseconds per tick
  542.  
  543.           This  function  is used  to determine  the characteristic  of the
  544.           timer tick for the computer.
  545.  
  546.           Application  programs  can  use  information  returned  by   this
  547.           function to dynamically  set up  code that is  executed on  every
  548.           timer tick. 
  549.  
  550.           -----------------------------------------------------------------
  551.  
  552.           Function 08h - Flush output buffer.
  553.  
  554.                Input:    AH = 08h
  555.                          DX = Port number
  556.  
  557.                Output:   Nothing
  558.  
  559.           This  function  is  used to  wait  until  any  pending output  is
  560.           transmitted.   It does not  return until all  buffered output has
  561.           been sent.  This function should be used with care.  Flow control
  562.           (documented  below) can  cause your  system hang  in a  tight un-
  563.           interruptable loop given the right circumstances.
  564.  
  565.           Note:  X00 executes functions with  the interrupt mask  set as it
  566.           was when  entered.   That is,  if X00  is called will  interrupts
  567.           masked, interrupts  will remain  masked during the  processing of
  568.           the function.  If this function is called with interrupts masked,
  569.           it may never return.
  570.  
  571.           -----------------------------------------------------------------
  572.  
  573.           Function 09h - Purge output buffer.
  574.  
  575.                Input:    AH = 09h
  576.                          DX = Port number
  577.  
  578.                Output:   Nothing
  579.  
  580.           This function  is used to  remove any buffered  output (transmit)
  581.           data.   Any  output  data remaining  in  the output  buffer  (not
  582.           transmitted yet) is discarded.
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                                                                          10
  591.  
  592.  
  593.  
  594.  
  595.           Function 0Ah - Purge input buffer.
  596.  
  597.                Input:    AH = 0Ah
  598.                          DX = Port number
  599.  
  600.                Output:   Nothing
  601.  
  602.           This function is  used to  remove any  buffered input  (received)
  603.           data.    Any  input data  which  is  in  the  receive  buffer  is
  604.           discarded.
  605.  
  606.           -----------------------------------------------------------------
  607.  
  608.           Function 0Bh - Transmit no wait.
  609.  
  610.                Input:    AH = 0Bh
  611.                          AL = Character
  612.                          DX = Port number
  613.  
  614.                Output:   AX = 0001h - Character was buffered for xmit
  615.                          AX = 0000h - Character was not buffered
  616.  
  617.           This is exactly  the same as  function 01h, except  that it  will
  618.           always  return immediately.    If X00  is  unable to  buffer  the
  619.           character  (the transmit  buffer is  full), a  value of  0000h is
  620.           returned in AX. If X00 accepts the character (room is available),
  621.           0001h is returned in AX.
  622.  
  623.           -----------------------------------------------------------------
  624.  
  625.           Function 0Ch - Non-destructive read-ahead (Peek).
  626.  
  627.  
  628.                Input:    AH = 0Ch    
  629.                          DX = Port number
  630.  
  631.                Output:   AH = 00h if character is available
  632.                          AL = Next character if available
  633.                          AX = 0FFFFh = If no character is available
  634.  
  635.           This function returns the next character from the receive buffer.
  636.           If the  receive buffer is empty,  0FFFFh is returned in  AX.  The
  637.           character   returned  remains   in  the   receive   buffer.  Some
  638.           programmers call this function "peek".
  639.  
  640.           Function 20h is a destructive read with no wait.
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.                                                                          11
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.           Function 0Dh - Keyboard read without wait.
  662.  
  663.  
  664.                Input:    AH = 0Dh
  665.  
  666.                Output:   AX = IBM-style scan code if available
  667.                             = 0FFFFh if no character not available
  668.  
  669.           This  function  returns  the  keyboard  scan  code  of  the  next
  670.           character from  the keyboard.   This is a  non-destructive (peek)
  671.           read of  the keyboard.  If no keyboard data is available,  0FFFFh
  672.           is returned in AX.
  673.  
  674.           -----------------------------------------------------------------
  675.  
  676.           Function 0Eh - Keyboard read with wait.
  677.  
  678.                Input:    AH = 0Eh
  679.  
  680.                Output:   AX = Keyboard scan code
  681.  
  682.           This  function  return  the  next character  available  from  the
  683.           keyboard.  If no keyboard input is available, this function waits
  684.           until  a keyboard  character  is available.   Returned  character
  685.           codes are the same as function 0Dh (IBM style scan codes). 
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.                                                                          12
  694.  
  695.  
  696.           Function 0Fh - Flow Control for serial I/O.
  697.  
  698.                Input:    AH = 0Fh
  699.                          AL = Bit defining the flow control to use
  700.                          DX = Port number
  701.  
  702.                Output:   Nothing
  703.  
  704.           Two kinds of basic flow control are supported.  One is  software,
  705.           called  Xon/Xoff  flow control.   The  other is  hardware, called
  706.           RTS/CTS flow  control.  Both  software and hardware  flow control
  707.           may be enabled at the same time.
  708.  
  709.           The bits in the parameter passed in AL are as follows:
  710.  
  711.                          Bit 0 = 1      Enable receiving of Xon/Xoff
  712.                          Bit 1 = 1      Enable RTS/CTS flow control
  713.  
  714.                          Bit 2          Reserved (should be zero)
  715.                          Bit 3 = 1      Enable transmitting of Xon/Xoff
  716.  
  717.           Setting  an appropriate bit to  zero will cause  the flow control
  718.           associated with that bit to be disabled.  
  719.  
  720.           Enabling  the  receiving  of  Xon/Xoff  will  cause  X00  to stop
  721.           transmitting   upon  receiving   an  Xoff.     X00   will  resume
  722.           transmitting when an Xon is received.
  723.  
  724.           Enabling the sending of  Xon/Xoff will cause X00 to send  an Xoff
  725.           when its buffers are 3/4  full.  When the buffers are  emptied to
  726.           1/4 full, X00 will send an Xon.
  727.  
  728.           X00  WILL ALWAYS CEASE  TRANSMITTING WHEN CTS  IS LOWERED (TURNED
  729.           OFF).  TRANSMISSION WILL RESUME WHEN CTS IS RAISED (TURNED ON).
  730.  
  731.           When  RTS/CTS flow control is  enabled, X00 will  drop (turn off)
  732.           RTS when  the receive buffer is  3/4 full.  X00  will raise (turn
  733.           on) RTS  when the  receive buffer empties  to 1/4 full.   RTS/CTS
  734.           flow control is almost  always used by modems that  operate above
  735.           2400  baud.    Some  2400  baud  modems  also  use/allow  RTS/CTS
  736.           handshaking
  737.  
  738.           If the  baud rate is locked  in the command line  that loads X00,
  739.           RTS/CTS  handshaking is  forced.   In this case,  the application
  740.           program can not disable RTS/CTS handshaking.
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.                                                                          13
  749.  
  750.  
  751.  
  752.           Function 10h - Control-C  /  Control-K  checking and  transmitter
  753.                          disable/enable.
  754.  
  755.                Input:    AH = 10h    
  756.                          AL = Control bits (defined below)
  757.                          DX = Port number
  758.  
  759.                Output:   AX = 0001h - A Control-C/K has been received
  760.                             = 0000h - A Control-C/K has not been received
  761.  
  762.           This is  used for BBS operation, primarily.  A bit mask is passed
  763.           in AL with the following flags:
  764.  
  765.                Bit 0     Enable/disable Control-C / Control-K checking
  766.                Bit 1     Disable/enable the transmitter
  767.  
  768.           To enable Control C/K checking set bit 0 = 1, to disable set  bit
  769.           0  = 0.    When checking  is  enabled,  a received  Control-C  or
  770.           Control-K will set  a flag  (internal to X00).   The  Control-C/K
  771.           character will not be stored  in the input buffer.  The  state of
  772.           the  internal Control-C/K flag will  be returned (then reset) the
  773.           next time  this function is  called.   The returned value  may be
  774.           used by the BBS software as it wishes.
  775.  
  776.           The  transmitter disable  (bit 1  =  1) and  Enable (bit  1 =  0)
  777.           function lets the application program to inhibit the transmitter.
  778.  
  779.           The disable of the transmitter is not absolute.  Several internal
  780.           functions can  cause the  transmitter to be  re-enabled, such  as
  781.           receiving an Xon when receiving of Xon/Xoff is enabled.
  782.  
  783.           -----------------------------------------------------------------
  784.  
  785.           Function 11h - Set current cursor location.
  786.  
  787.                Input:    AH = 11h
  788.                          DH = Row (line)
  789.                          DL = Column
  790.  
  791.                Output:   Nothing
  792.  
  793.           This function  is exactly like INT 10h, subfunction 2, on the IBM
  794.           PC.  The  desired cursor location is passed in DX,  row in DH and
  795.           column in DL.  The row and column are relative to zero.  That is,
  796.           the home position on the screen is row 0, column 0.
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.                                                                          14
  805.  
  806.  
  807.  
  808.  
  809.           Function 12h - Read current cursor location.
  810.  
  811.                Input:    AH = 12h
  812.  
  813.                Output:   DH = Row (line)
  814.                          DL = Column
  815.  
  816.           This function  is exactly like INT 10h, subfunction 3, on the IBM
  817.           PC.   The  current  cursor location  (using  the same  coordinate
  818.           system as function 16h) is returned in DX.
  819.  
  820.           -----------------------------------------------------------------
  821.  
  822.           Function 13h - Single character ANSI write to screen.
  823.  
  824.                Input:    AH = 13h
  825.                          AL = Character to display
  826.  
  827.                Output:   Nothing
  828.  
  829.           The character passed in AL is sent displayed on the screen at the
  830.           current cursor location.   ANSI.SYS type processing is performed.
  831.           This routine should  not be used  in such a  way that DOS  output
  832.           (which is not re-entrant)  can not be employed by  X00 to execute
  833.           the function.
  834.  
  835.           -----------------------------------------------------------------
  836.  
  837.           Function 14h - Enable or disable the DCD watchdog.
  838.  
  839.                Input:    AH = 14h
  840.                          AL = 01h - Enable watchdog
  841.                             = 00h - Disable watchdog
  842.                          DX = Port number
  843.  
  844.                Output:   Nothing
  845.  
  846.           This  function enables  and  disables the  monitoring of  carrier
  847.           detect.   When enabled, the state  of the carrier detect (DCD) is
  848.           constantly  monitored  during  timer  tick  processing.    Should
  849.           carrier  detect  be  lost  (turned  off),  the  system  will   be
  850.           re-booted.  Activate/Deactivate etc  have no effect on the  state
  851.           of the DCD watchdog.
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.                                                                          15
  860.  
  861.  
  862.           Function 15h - Write character to screen using BIOS.
  863.  
  864.                Input:    AH = 15h
  865.                          AL = Character to display
  866.  
  867.                Output:   Nothing
  868.  
  869.           The character passed in AL is sent to the screen using BIOS-level
  870.           Input/Output routines.   This differs  from function 13h  in that
  871.           DOS I/O will not be used.
  872.  
  873.           -----------------------------------------------------------------
  874.  
  875.           Function 16h - Add or delete a routine from the timer tick chain.
  876.  
  877.                Input:    AH = 16h
  878.                          AL = 01h - Add a function
  879.                             = 00h - Delete a function
  880.                          ES = Segment of function
  881.                          DX = Offset of function
  882.  
  883.                Output:   AX =  0000h or  ticks per  second if  operation is
  884.                               successful
  885.                             = 0FFFFh - Operation unsuccessful
  886.  
  887.           This function  is used to allow a central authority to manage the
  888.           timer interrupts, so that the integrity of the "timer tick chain"
  889.           is  not compromised.  Rather than using the traditional method of
  890.           saving  the old contents of the timer vector, storing the address
  891.           of your routine there, and calling the "old" routine, instead you
  892.           call this  function.  X00 manages a list of such entry points and
  893.           calls them on a timer tick (interrupt) using a FAR call.
  894.  
  895.           X00  will allow  up to  4 programs  to hook  into the  timer tick
  896.           processing.  Interrupts  are enabled when the hooked routines are
  897.           called.
  898.  
  899.           CAUTION, when  this FOSSIL function was  implemented, it provided
  900.           the  best  means to  hook into  the  timer tick  on multi-tasking
  901.           systems  at that time.   However, with  the 386  and virtual 8086
  902.           mode  of  operation  used by  DESQview,  Windows  V3.0 etc,  this
  903.           function  can crash the system.   The reason  is the virtual 8086
  904.           application (task/window) that  hooked in, may not be  the active
  905.           virtual 8086 (task/window) when the timer tick interrupt occurs.
  906.  
  907.           Due to popularity of the virtual 8086 type multi-tasking systems,
  908.           the  author  (who  originally  insisted  that  this  function  be
  909.           created) RECOMMENDS THAT THIS FUNCTION NOT BE USED.
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.                                                                          16
  918.  
  919.  
  920.           Function 17h - Reboot system.
  921.  
  922.                Input:    AH = 17h
  923.                          AL = 00h - "Cold boot"
  924.                             = 01h - "Warm boot"
  925.  
  926.                Output:   Nothing
  927.  
  928.           This  function is intended primarily  as a security  feature.  It
  929.           provides  the  application  with  a  last resort  escape  from  a
  930.           situation that could allow a security breach.
  931.  
  932.           -----------------------------------------------------------------
  933.  
  934.           Function 18h - Block Read.
  935.  
  936.  
  937.                Input:    AH = 18h
  938.                          CX = Requested number of characters to transfer
  939.                          DX = Port number
  940.                          ES = Segment of the caller's buffer
  941.                          DI = Offset of the caller's buffer
  942.  
  943.                Output:   AX = Number of characters actually transferred
  944.  
  945.           This function will transfer from 0 to 65534 characters from X00's
  946.           inbound circular  buffer to  the caller's  buffer. ES:DI  are not
  947.           changed by  this function.   The  number of  bytes placed  in the
  948.           caller's buffer is  returned in AX.   The  number returned in  AX
  949.           will be the lesser of the caller's requested amount or the entire
  950.           contents (if any) of X00's receive buffer.
  951.  
  952.           -----------------------------------------------------------------
  953.  
  954.           Function 19h - Block Write.
  955.  
  956.                Input:    AH = 19h
  957.                          CX = Requested number of characters to transfer
  958.                          DX = Port number
  959.                          ES = Segment of the caller's buffer
  960.                          DI = Offset of the caller's buffer
  961.  
  962.                Output:   AX = Number of characters actually transferred
  963.  
  964.           This function will transfer  from 0 to 65534 characters  to X00's
  965.           outbound  circular  buffer.    ES:DI  are  not  changed  by  this
  966.           function.  The number of bytes placed in X00's buffer is returned
  967.           in AX.   The  number returned  in AX  will be  the lesser  of the
  968.           caller's requested amount or the amount (if any) required to fill
  969.           X00's transmit buffer.
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.                                                                          17
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.           Function 1Ah - Break begin or end.
  992.  
  993.                Input:    AH = 1Ah
  994.                          AL = 01h - Start sending 'break'
  995.                             = 00h - Stop sending 'break'
  996.                          DX = port number
  997.  
  998.                Output:   Nothing
  999.  
  1000.           This function will  start or terminate a break signal.  If AL=01h
  1001.           X00 will start the transmission  of a break.  If AL=00h  X00 will
  1002.           terminate  any  break  signal.    This  function  is  useful  for
  1003.           activating command mode on some modems.  The  application program
  1004.           is responsible  for the timing  of the  BREAK.  If  X00 has  been
  1005.           restrained by an Xoff received  from the modem, the flag  will be
  1006.           cleared.   An  Activate or  Deavtivate will  stop an  in-progress
  1007.           BREAK.  
  1008.  
  1009.           It is the  experience of the author that the  duration of a break
  1010.           should be less than 0.1 seconds.
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.                                                                          18
  1019.  
  1020.  
  1021.           Function 1Bh - Return information about X00.
  1022.  
  1023.                Input:    AH = 1Bh
  1024.                          CX = Size of caller's info buffer in bytes
  1025.                          DX = Port number
  1026.                          ES = Segment of caller's info buffer
  1027.                          DI = Offset of caller's info buffer
  1028.  
  1029.                Output:   AX = Number of bytes actually transferred
  1030.                          CX = '0X'      First 2 bytes of 'X00 ' string
  1031.                          DX = ' 0'      Second 2 bytes of 'X00 ' string
  1032.  
  1033.           Note  that the  values returned  in CX  and DX  can be  stored in
  1034.           memory to form a  space terminated string 'X00 '.   Additionally,
  1035.           the values returned in CX and DX can be used to  determine if X00
  1036.           is installed.
  1037.  
  1038.           This function will transfer information about X00 and its current
  1039.           status  to the  caller.   This  function  is intended  to  assist
  1040.           "generic" applications to adjust to the current environment.
  1041.  
  1042.           The data structure  (assembly language style)  currently returned
  1043.           by X00 is as follows:
  1044.  
  1045.                INFO      EQU  $              ;DEFINE BEGIN OF STRUCTURE
  1046.                STRSIZ    DW   INFO_SIZE      ;SIZE OF THIS STRUC IN BYTES
  1047.                MAJVER    DB   CURR_FOSSIL    ;FOSSIL SPECIFICATION REV
  1048.                MINVER    DB   CURR_REV       ;REV OF THIS DRIVER.
  1049.                IDENT     DD   ID_STRING      ;"FAR" POINTER TO ASCIIZ
  1050.                                              ; DRIVER DESCRIPTION STRING.
  1051.                IBUFR     DW   IBSIZE         ;BYTE SIZE OF THE INPUT BUFFER
  1052.                IFREE     DW   ?              ;NUMBER OF BUFFERED RECV BYTES
  1053.                OBUFR     DW   OBSIZE         ;BYTE SIZE OF THE XMIT BUFFER
  1054.                OFREE     DW   ?              ;NUMBER OF BUFFERED XMIT BYTES
  1055.                SWIDTH    DB   SCREEN_WIDTH   ;WIDTH OF DISPLAY SCREEN
  1056.                SHEIGHT   DB   SCREEN_HEIGHT  ;HEIGHT OF DISPLAY SCREEN
  1057.                BAUD      DB   ?              ;BAUD RATE, COMPUTER TO MODEM
  1058.  
  1059.           The IDENT  string  is null-terminated,  and  does not  contain  a
  1060.           newline.  The baud rate byte contains  the bits that Function 00h
  1061.           would use to set the port to that speed.
  1062.  
  1063.           The  fields related to a particular port (buffer size, space left
  1064.           in the  buffer, baud rate) will  be undefined if port  0FFh or an
  1065.           invalid port is contained in DX.
  1066.  
  1067.           In some cases  X00 can  not accurately return  information.   For
  1068.           example, the user can  lock the baud rate at  115200 when loading
  1069.           X00.  There is no correct FOSSIL value that X00 can return in the
  1070.           BAUD  field.  X00 will set the  BAUD field equal to the last baud
  1071.           rate that the application attempted to set.
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.                                                                          19
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.           Superset Functions.
  1099.  
  1100.           Function  numbers above 1Bh and below 7Eh are X00 only functions.
  1101.           These functions will only  work with X00.  It is  the hope of the
  1102.           author that these functions will be added by other FOSSIL authors
  1103.           in  their  implementations  and  become  a  part  of  the  FOSSIL
  1104.           specification.
  1105.  
  1106.           Functions  1Ch and 1Dh are exact duplicated of FOSSIL functions 4
  1107.           and 5.
  1108.  
  1109.           Functions  1Eh and  1Fh are  intended to  be exact  duplicates of
  1110.           functions 4 and 5 of the PS/2's BIOS INT 14h.
  1111.  
  1112.           Function 20h is a destructive read with no wait.
  1113.  
  1114.           Function 21h is a Stuff/Poke character into the receive buffer.
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.                                                                          20
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.           Function  1Ch is  a  duplicate of  function 4.   The  function is
  1133.           duplicated so that at a future date, X00 functions 4 and 5 can be
  1134.           made compatible to the PS/2's function 4 and 5.
  1135.  
  1136.           Developers  are encouraged by the author to start using functions
  1137.           1Ch and  1Dh instead of functions  4 and 5.   See the application
  1138.           notes  section  for  instructions   on  a  compatible  method  of
  1139.           determining  if functions 1Ch and  1Dh should be  used instead of
  1140.           functions 4 and 5.
  1141.  
  1142.           Function 1Ch - Activate Port.
  1143.  
  1144.                Input:    AH = 1Ch
  1145.                          DX = port number
  1146.  
  1147.                Output:   AX = 1954h if successful
  1148.                          BL  =  maximum  function  number   supported  (not
  1149.                          counting functions 7Eh and above)
  1150.                          BH = rev of FOSSIL specification supported
  1151.  
  1152.           This function instructs X00  to use the FOSSIL  specification for
  1153.           the specified port.  Prior to issuing this function, any function
  1154.           that requires a port  number in DX will  be passed on to  BIOS or
  1155.           X00's  INT 14h BIOS emulator.  When this function  is called, all
  1156.           interrupts  involved   in  supporting  the   communications  port
  1157.           (specified in DX) are set up for  support by X00.  DTR is  turned
  1158.           on by this function.  The baud rate is NOT set or changed by this
  1159.           function.
  1160.  
  1161.           If an additional call  to this function occurs (2  Inits or Init,
  1162.           Read, Init, etc.) X00 will reset (clear) all buffers and all flow
  1163.           control is turned  off.  Values returned in the  registers upon a
  1164.           re-init are the same as an initial init (defined above).
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.                                                                          21
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.           Function  1Dh  is a  duplicate of  function 5.   The  function is
  1187.           duplicated so that at a future date, X00 functions 4 and 5 can be
  1188.           made compatible to the PS/2's functions 4 and 5.
  1189.  
  1190.           Developers  are encouraged by the author to start using functions
  1191.           1Ch and  1Dh instead of functions  4 and 5.   See the application
  1192.           notes  section  for  instructions  on  a  compatible  method   of
  1193.           determining  if functions 1Ch and  1Dh should be  used instead of
  1194.           functions 4 and 5.
  1195.  
  1196.           Function 1Dh - Deactivate Port.
  1197.  
  1198.                Input:    AH = 1Dh
  1199.                          DX = Port number
  1200.  
  1201.                Output:   Nothing
  1202.  
  1203.           This function instructs X00  that it should no longer  to process
  1204.           calls for  specified port (in DX) using the FOSSIL specification.
  1205.           If the port was never activated by function 4, then this function
  1206.           is ignored.  Any  subsequent function calls, that require  a port
  1207.           number  in  DX, will  be  passed  to BIOS  or  the  BIOS INT  14h
  1208.           emulator.
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.                                                                          22
  1217.  
  1218.           Function 1Eh - Extended line control initialization.
  1219.  
  1220.           This  function is intended to exactly emulate the PS/2's BIOS INT
  1221.           14 services,  function 4.  Some or  all of the functions provided
  1222.           here  are duplicated by other  X00 functions.   In addition, once
  1223.           this  function  is called,  function 0h  will  not be  allowed to
  1224.           changed the baud rate.   Function 0 will again be allowed  to set
  1225.           the baud rate when  this function is called with CL=0FFh  or when
  1226.           the FOSSIL functions are turned off.
  1227.  
  1228.                Input:    AH = 1Eh
  1229.  
  1230.                          AL = Break, Where:
  1231.                             = 00h, No break and/or turn off break
  1232.                             = 01h, Start send of break.
  1233.  
  1234.                          BH = Parity, where:
  1235.                             = 00h, No parity
  1236.                             = 01h, Odd parity
  1237.                             = 02h, Even parity
  1238.                             = 03h, Mark parity (always 1)
  1239.                             = 04h, Space parity (always 0)
  1240.  
  1241.                          BL = Stop bits, where:
  1242.                             = 00h, One stop bit
  1243.                             = 01h, Two stop bits  for 6, 7  and 8 bit  word
  1244.                                    length, 1  and 1/2  stop bits for  5 bit
  1245.                                    word length.
  1246.  
  1247.                          CH = Word length, where:
  1248.                             = 00h, 5 bits
  1249.                             = 01h, 6 bits
  1250.                             = 02h, 7 bits
  1251.                             = 03h, 8 bits
  1252.  
  1253.                          CL = Baud rate, where:
  1254.                             = 00h, 110 baud
  1255.                             = 01h, 150 baud
  1256.                             = 02h, 300 baud
  1257.                             = 03h, 600 baud
  1258.                             = 04h, 1200 baud
  1259.                             = 05h, 2400 baud
  1260.                             = 06h, 4800 baud
  1261.                             = 07h, 9600 baud
  1262.                             = 08h, 19200 baud
  1263.           ; Note the following are FOSSIL only baud rates.
  1264.                             = 80h, 28800 baud
  1265.                             = 81h, 38400 baud
  1266.                             = 82h, 57600 baud
  1267.                             = 83h, reserved (future 76800 baud)
  1268.                             = 84h, 115200 baud
  1269.                             = 0FFh, re-enable function 0 to set baud
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.                                                                          23
  1278.  
  1279.                          DX = Port number
  1280.  
  1281.                Output:   AX = Port status (see function 03h)
  1282.  
  1283.           If  locked at X00 load  time, the appropriate  parameters of this
  1284.           function are ignored.
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.                                                                          24
  1293.  
  1294.  
  1295.  
  1296.  
  1297.           Function 1Fh - Extended serial port status/control.
  1298.  
  1299.           This  function is intended to exactly emulate the PS/2's BIOS INT
  1300.           14 services, function  5.  Some or all of  the functions provided
  1301.           here are duplicated by other X00 functions.   This function has 2
  1302.           subfunctions specified by AL.
  1303.  
  1304.           Subfunction 00h - Read MCR
  1305.  
  1306.                Input:    AH = 1Fh
  1307.                          AL = 00h, Read modem control register (MCR)
  1308.                          DX = Port number
  1309.  
  1310.                Output:   AX = Port status (see function 03h)
  1311.                          BL = Modem control register, where:
  1312.                               Bits 7-5 = 0 (Reserved)
  1313.                               Bit 4    = 1 Loopback mode
  1314.                               Bit 3    = 1 OUT2 (interrupts) enabled
  1315.                               Bit 2    = 1 OUT1 active
  1316.                               Bit 1    = 1 Request to send active
  1317.                               Bit 0    = 1 Data terminal ready (DTR) active
  1318.  
  1319.           Subfunction 01h - Write MCR
  1320.  
  1321.                Input:    AH = 1Fh
  1322.                          AL = 01h, Write modem control register (MCR)
  1323.                          BL = Modem control register, where:
  1324.                               Bits 7-5 = 0 (Reserved)
  1325.                               Bit 4    = 1 Set loopback mode
  1326.                               Bit 3    = 1 Set OUT2 enable interrupts
  1327.                               Bit 2    = 1 Set OUT1 active (on)
  1328.                               Bit 1    = 1 Set Request to send active (on)
  1329.                               Bit 0    = 1 Set DTR active (on)
  1330.                          DX = Port number
  1331.  
  1332.                Output:   AX = Port status (see function 03h)
  1333.  
  1334.           In subfunction 01h (write  MCR) X00 will force bit 3  to 1.  That
  1335.           is,  X00  will not  allow  the  communications interrupts  to  be
  1336.           disabled.
  1337.  
  1338.           RTS may  be used  as a  flow  control signal  by X00.   When  the
  1339.           application program writes the MCR, the  RTS bit is treated as an
  1340.           RTS enable  bit.   This  means  that X00  will always  allow  the
  1341.           application program to turn RTS off.  However, X00 will  not turn
  1342.           on RTS unless it is safe to do so.
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.                                                                          25
  1351.  
  1352.  
  1353.  
  1354.           Function 20h - Read with no wait (destructive).
  1355.  
  1356.  
  1357.                Input:    AH = 20h
  1358.                          DX = Port number
  1359.  
  1360.                Output:   AH = 00h if character is available
  1361.                          AL = Next character if available
  1362.                          AX = 0FFFFh If no character is available
  1363.  
  1364.           This function returns the next character from the receive buffer.
  1365.           If the receive buffer is  empty, 0FFFFh is returned in AX.   This
  1366.           function  is the same as  function 0Ch except  that any character
  1367.           returned is removed from the receive buffer.
  1368.  
  1369.           ----------------------------------------------------------------
  1370.  
  1371.           Function 21h - Stuff/Poke the receive buffer.
  1372.  
  1373.  
  1374.                Input:    AH = 20h
  1375.                          AL = Character to place in the receive buffer
  1376.  
  1377.                Output:   Nothing
  1378.  
  1379.           This function will  insert the passed character  into the receive
  1380.           buffer (at the end).  Subsequent reading of the serial input will
  1381.           read the character.  The character is inserted at the  end of the
  1382.           buffer (as though it were just received).
  1383.  
  1384.           The  character is inserted into the receive buffer by calling the
  1385.           receive interrupt  routine.    All  normal  receive  checking  is
  1386.           preformed on the character.  Some things to note are:
  1387.  
  1388.                If  receiving  of  Xon/Xoff  is   enabled  and  an  Xoff  is
  1389.                stuffed/poked  into the  buffer,  the transmitter  will stop
  1390.                until a an Xon is received or stuffed/poked.
  1391.  
  1392.                If  Control C/K  checking is  enabled and  a Control  C/K is
  1393.                stuffed/poked, then the character  is not put in  the buffer
  1394.                and the internal flags is set.
  1395.  
  1396.           The above should give you a little to think about when using this
  1397.           function.
  1398.  
  1399.           This  function  is intended  to be  fully  re-entrant.   Thus, it
  1400.           should be callable from timer tick processing etc.
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.                                                                          26
  1409.  
  1410.  
  1411.  
  1412.  
  1413.           "Layered Application" services.
  1414.  
  1415.  
  1416.           The   functions   below  are   provided   to   meet  the   FOSSIL
  1417.           specification.   The following  functions  in effect  make X00  a
  1418.           dispatcher for other programs.
  1419.  
  1420.           To  operate  properly  on   a  multi-port  system,  any  "Layered
  1421.           Application" must be re-entrant.   The only "Layered Application"
  1422.           know  to the  author is  called a  Video FOSSIL.   The  one Video
  1423.           Fossil known to the author is not re-entrant and can  not be used
  1424.           on a multi-port system.
  1425.  
  1426.  
  1427.           Function 7Eh - Install an "external application" function.
  1428.  
  1429.                Input:    AH = 7Eh    
  1430.                          AL = Code assigned to external application
  1431.                          DX = Offset of application entry point
  1432.                          ES = Segment of application entry point
  1433.  
  1434.                Output:   AX = 1954h
  1435.                          BL = Code given to application (same as input AL)
  1436.                          BH = 01h - Installation was successful
  1437.                             = 00h - Installation failed
  1438.  
  1439.           This  function may be used by  external application code (special
  1440.           screen  drivers, modem code, database code, etc) to link into the
  1441.           INT 14h service  for use  by multiple applications.   The  "error
  1442.           return"  (BH=0   with  AX=1954h)   should  mean  that     another
  1443.           application layer  has already been installed  at that particular
  1444.           code. Codes 80h through 0BFh are be supported.  
  1445.  
  1446.           External   application  codes  80h-83h  are  reserved  by  FOSSIL
  1447.           developers  for  re-organizing  FOSSIL  services by  type  (comm,
  1448.           screen, keyboard, system).  
  1449.  
  1450.           Installed  application code will be entered, via a FAR call, from
  1451.           the  INT 14H  dispatcher  whenever  it  is  entered  (with  AH  =
  1452.           application code).
  1453.  
  1454.           If the value returned in AX  from this function is not 1954h, the
  1455.           service code that  is trying to be installed should  bring up its
  1456.           own  INT  14h code  that can  service  INT 14h  functions 7h-0BFh
  1457.           (80h-0BFh are "applications").
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.                                                                          27
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.           Function 7Fh - Remove an "external application" function.
  1483.  
  1484.                Input:    AH = 7Fh
  1485.                          AL = Code assigned to external application
  1486.                          DX = Offset of application entry point
  1487.                          ES = Segment of application entry point
  1488.  
  1489.                Output:   AX = 1954h
  1490.                          BL = Code given to application (same as input AL)
  1491.                          BH = 01h - Removal was successful
  1492.                             = 00h - Removal failed
  1493.  
  1494.           This  function removes an application's entry from the table.  If
  1495.           an error is returned, this means ES:DX did not match any entry at
  1496.           the  slot described by  AL.  An application  that wants to remove
  1497.           itself from memory  can issue  the 7F function  to remove  itself
  1498.           from  the  table,  then,  if it  is  successful,  un-install.  If
  1499.           installed with an INT  14h dispatcher it may  un-install provided
  1500.           no other application(s) have  been installed on top of  it (using
  1501.           its dispatcher).
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.                                                                          28
  1510.  
  1511.  
  1512.                                   Application Notes.
  1513.  
  1514.           Which Activate/Deactivate functions to use
  1515.  
  1516.           It is  the hope of  the author (after  a period of  time) to make
  1517.           X00's  functions 4  and  5 compatible  with  the PS/2's  INT  14h
  1518.           functions  4  and 5.    Currently, X00's  functions 4  and  5 are
  1519.           duplicated at functions 1Ch and 1Dh respectively.  I request that
  1520.           application  programmers start  using  functions 1Ch  and 1Dh  if
  1521.           those  functions are available.   That is, use  functions 1Ch and
  1522.           1Dh instead of functions 4 and 5 respectively.
  1523.  
  1524.           It is relatively simple to determine if the  functions at 1Ch and
  1525.           1Dh are available.   When your  program is ready to  activate X00
  1526.           for a given port, issue function 1Ch.  If 1954h is returned, then
  1527.           the port  is activated.   If 1954h  is not returned,  reissue the
  1528.           request to function 4.  Save the function number actually used to
  1529.           activate the port,  then increment  it by one  to deactivate  the
  1530.           port.
  1531.  
  1532.           Watch out for disk I/O
  1533.  
  1534.           Chris Irwin deserves  credit for discovering and  informing me of
  1535.           the following:  On  some (if not all) IBM/Clones,  interrupts are
  1536.           masked  for a long  period of  time during  DOS disk  I/O.   As a
  1537.           result, data  characters were  being lost  during  receive.   The
  1538.           problem is most noticeable on slower (4.77 meg) systems with 8250
  1539.           or 16450 type SIO chips installed using high speed modems.
  1540.  
  1541.           Remembering  that  all high  speed modems  (that  I know  of) use
  1542.           RTS/CTS  handshaking, I implemented a back door hook in some Beta
  1543.           X00s that  allowed Chris to turn  RTS off prior to  any disk I/O.
  1544.           Turning off  RTS while  a disk  write is  taking place fixed  the
  1545.           problem.   Also, turning off RTS  during disk I/O had  no adverse
  1546.           effect  on the transfer speed due to the modems internal buffers.
  1547.           While RTS is off,  the modem simply buffers the  data internally.
  1548.           When  RTS is  again  turned on,  the  modems internal  buffer  is
  1549.           emptied  because the transfer rate from the modem to the computer
  1550.           is faster than the line receive rate.
  1551.  
  1552.           X00  now has a front door (documented) function (1Fh) that allows
  1553.           application  programs to disable RTS.  Note that X00 function 1Fh
  1554.           is not a FOSSIL function.  I hope that it  will eventually become
  1555.           a FOSSIL function.  X00s function  1Fh is close to a duplicate of
  1556.           the PS/2's BIOS INT 14h, function 5.
  1557.  
  1558.           I strongly suggest that  application programmers consider turning
  1559.           off (disabling) RTS prior to any disk  I/O.  Even if the modem is
  1560.           not  using RTS/CTS handshaking, turning  off RTS will  not do any
  1561.           harm (that I know of).
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.                                                                          29
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.           Successive timer tick calls
  1576.  
  1577.           In some  environments,  the timer  tick chain  is called  several
  1578.           times in succession with  no delay between the calls.   I believe
  1579.           that one such environment is DESQview.  If a task has been asleep
  1580.           for 10  timer ticks, the timer tick chain will be called 10 times
  1581.           when the task is activated.
  1582.  
  1583.           X00 checks the DWORD at 46Ch.  If the  value at that location has
  1584.           not  changed,  X00  ignores  the  timer  tick.    Any  hooked  in
  1585.           application programs are not called.
  1586.  
  1587.           This  means  that the  timer tick  is  not reliable  for accurate
  1588.           timing.   All programs  (that I  know of)  that alter  the normal
  1589.           timer  tick  processing keeps  the DWORD  at  46Ch (time  of day)
  1590.           updated.  If not, your  time of day will be off.  If  you need to
  1591.           know elapsed  time, do not count  timer ticks.  Use  the DWORD at
  1592.           46Ch to calculate elapsed time.  The value stored in the DWORD at
  1593.           46Ch  is the number of timer ticks  since the computer was booted
  1594.           or the number of timer ticks past midnight.
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.                                                                          30
  1603.  
  1604.  
  1605.  
  1606.           Application Notes . . . . . . . . . . . . . . . . . . . . . .  28
  1607.           FOSSIL  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
  1608.           Function 00h  . . . . . . . . . . . . . . . . . . . . . . . . . 4
  1609.           Function 01h  . . . . . . . . . . . . . . . . . . . . . . . . . 5
  1610.           Function 02h  . . . . . . . . . . . . . . . . . . . . . . . . . 5
  1611.           Function 03h  . . . . . . . . . . . . . . . . . . . . . . . . . 6
  1612.           Function 04h  . . . . . . . . . . . . . . . . . . . . . . . . . 7
  1613.           Function 05h  . . . . . . . . . . . . . . . . . . . . . . . . . 8
  1614.           Function 06h  . . . . . . . . . . . . . . . . . . . . . . . . . 8
  1615.           Function 07h  . . . . . . . . . . . . . . . . . . . . . . . . . 9
  1616.           Function 08h  . . . . . . . . . . . . . . . . . . . . . . . . . 9
  1617.           Function 09h  . . . . . . . . . . . . . . . . . . . . . . . . . 9
  1618.           Function 0Ah  . . . . . . . . . . . . . . . . . . . . . . . .  10
  1619.           Function 0Bh  . . . . . . . . . . . . . . . . . . . . . . . .  10
  1620.           Function 0Ch  . . . . . . . . . . . . . . . . . . . . . . . .  10
  1621.           Function 0Dh  . . . . . . . . . . . . . . . . . . . . . . . .  11
  1622.           Function 0Eh  . . . . . . . . . . . . . . . . . . . . . . . .  11
  1623.           Function 0Fh  . . . . . . . . . . . . . . . . . . . . . . . .  12
  1624.           Function 10h  . . . . . . . . . . . . . . . . . . . . . . . .  13
  1625.           Function 11h  . . . . . . . . . . . . . . . . . . . . . . . .  13
  1626.           Function 12h  . . . . . . . . . . . . . . . . . . . . . . . .  14
  1627.           Function 13h  . . . . . . . . . . . . . . . . . . . . . . . .  14
  1628.           Function 14h  . . . . . . . . . . . . . . . . . . . . . . . .  14
  1629.           Function 15h  . . . . . . . . . . . . . . . . . . . . . . . .  15
  1630.           Function 16h  . . . . . . . . . . . . . . . . . . . . . . . .  15
  1631.           Function 17h  . . . . . . . . . . . . . . . . . . . . . . . .  16
  1632.           Function 18h  . . . . . . . . . . . . . . . . . . . . . . . .  16
  1633.           Function 19h  . . . . . . . . . . . . . . . . . . . . . . . .  16
  1634.           Function 1Ah  . . . . . . . . . . . . . . . . . . . . . . . .  17
  1635.           Function 1Bh  . . . . . . . . . . . . . . . . . . . . . . . .  18
  1636.           Function 1Ch  . . . . . . . . . . . . . . . . . . . . . . . .  20
  1637.           Function 1Dh  . . . . . . . . . . . . . . . . . . . . . . . .  21
  1638.           Function 1Eh  . . . . . . . . . . . . . . . . . . . . . . . .  22
  1639.           Function 1Fh  . . . . . . . . . . . . . . . . . . . . . . . .  24
  1640.           Function 20h  . . . . . . . . . . . . . . . . . . . . . . . .  25
  1641.           Function 21h  . . . . . . . . . . . . . . . . . . . . . . . .  25
  1642.           Function 7Eh  . . . . . . . . . . . . . . . . . . . . . . . .  26
  1643.           Function 7Fh  . . . . . . . . . . . . . . . . . . . . . . . .  27
  1644.           Licensing Information . . . . . . . . . . . . . . . . . . . . . 2
  1645.                Commercial License . . . . . . . . . . . . . . . . . . . . 2
  1646.                Non-Commercial License . . . . . . . . . . . . . . . . . . 2
  1647.           RTS/CTS flow control  . . . . . . . . . . . . . . . . . . . .  12
  1648.           SIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
  1649.           Warranty  . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
  1650.           WHAT IS X00 . . . . . . . . . . . . . . . . . . . . . . . . . . 1
  1651.           Xon/Xoff flow control . . . . . . . . . . . . . . . . . . . .  12
  1652.